const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const outputPath = path.resolve(__dirname, '../dist/api');

module.exports = {
    entry: './app.js',
    target: "node",
    output: {
        path: outputPath,
        filename: 'app.js',
    },
    plugins: [
        new CopyWebpackPlugin({
            patterns: [
                {from: 'public', to: outputPath + '/public'},
                {from: 'package.json', to: outputPath + '/package.json'},
            ],
        }),
    ],
};